home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #ifndef MAIN_H
- #define MAIN_H
-
- #include "resources.h"
- #include "sw_comm.h"
- class SbVec2s;
- class SbVec3f;
- class ShipObject;
-
- int self(const ShipObject*);// TRUE if it's my ship
- int self(InAddr); // TRUE if it's my ship
- int self(NetId); // TRUE if it's my ship
- void restartSelf(); // restart my ship
- SwServer* server(); // return server
- void quitSpaceWar(); // exit game
- int numberPlayers(); // get number of players
- ShipObject* getPlayer(int num); // get ship info
- int addPlayer(ShipObject*); // returns TRUE if successful
- ShipObject* removePlayer(int num); // returns removed ship
- int lookupPlayer(NetId); // find player by network id
- TeamInfo& getTeam(Team); // get team information
- void setTeam(const TeamInfo& info);
- int numberTargets(); // number targets available
- int currentTarget(); // number of current target
- ShipObject* getTarget(int num); // get target info
- void nextTarget(); // select next target
- void prevTarget(); // select previous target
- void noTarget(); // set to no target
- float radarRange(); // current radar range (m)
- void increaseRange(); // go to next highest range
- void decreaseRange(); // go to next lowest range
- Weapon currentWeapon(); // get current weapon
- void currentWeapon(Weapon); // set current weapon
- void toggleFps(); // toggle fps display
- int isFpsOn(); // TRUE if fps displayed
- int getFps(); // returns current fps
- SbVec2s& viewScreenSize(); // returns view size in pixels
- void showHelp(); // pause and show help
- void pauseGame(); // pause game (if not paused)
- void resumeGame(); // resume game (if paused)
- void togglePauseGame(); // toggle 'tween paused/resumed
- int isPaused(); // TRUE if game paused
- void quitGame(); // exit game
- ShipObject* makeShip(ShipClass, NetId, Team, const char*);
- float explodeVolume(float p[3], float v = 1.0);
-
- // return direction of pixel in local space
- void getViewDirection(const SbVec2s& p, SbVec3f& v);
-
- // return pixel location of direction in local space (FALSE if behind)
- int getViewPosition(const SbVec3f& v, SbVec2s& p);
-
- // view screen position, relative size, and visibility of every object
- struct ObjectView {
- public:
- SbVec3f lp; // local position
- int visible; // TRUE if on screen
- int exploding; // TRUE if exploding
- short p[2]; // view screen position
- short r; // radius of object in pixels
- };
-
- extern ObjectView playerView[MAXPLAYERS][MAXMISSILES+1];
- extern ObjectView asteroidView[MAXASTEROIDS];
- extern ObjectView flagView[NUMTEAMS];
- extern ObjectView missileLock;
- extern int wasFlagCaptured; // TRUE if my flag just captured
-
- #endif
-